import request from '@/utils/request'
// 引入数据类型
import type {trademark,trademarkResponseData} from '@/api/product/trademark/model/trademark'

// 枚举地址
enum API{
    TRADEMARKLIST = '/admin/product/baseTrademark/',
    ADDTRADEMARK = '/admin/product/baseTrademark/save',
    UPDATETRADEMARK = '/admin/product/baseTrademark/update',
    DELET = '/admin/product/baseTrademark/remove/'//删除品牌接口
}

// 获取品牌数据接口
export const reqTradeMarkList = (page:number,limit:number) =>request.get<any,trademarkResponseData>(API.TRADEMARKLIST+`${page}/${limit}`)

// 新增或修改品牌接口
export const reqAddUpdateTradeMark = (data:trademark)=>{
    if(data.id){
        // 修改品牌数据
        return request.put<any,any>(API.UPDATETRADEMARK, data);
    } else {
        //新增品牌
        return request.post<any,any>(API.ADDTRADEMARK, data);
    }

}

// 删除品牌接口
export const reqDeleteTradeMark = (id:number)=>request.delete<any,any>(API.DELET+id)